<%@ page language="java" import="java.util.*,web.java.entity.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://demo.java.a_tag" prefix="demo" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>自定义标签显示用户ip地址</title>
  </head>
  
  <body>
  	
  	<%
		Student s1=new Student("cainter","20");
		Student s2=new Student("monster","18");
		Student s3=new Student("master","30");
		Student s4=new Student("cyder","26");
		ArrayList<Student> studentList=new ArrayList<Student>();
		studentList.add(s1);
		studentList.add(s2);
		studentList.add(s3);
		studentList.add(s4);
		pageContext.setAttribute("studentList",studentList);
    	Map<String,String> map=new HashMap<String, String>();
    	map.put("001", "cainter");
    	map.put("002","moster");
    	pageContext.setAttribute("map",map);
  	%>
  	<demo:forEach items="${studentList }" var="student">
  		<p>${student.name }</p>
  	</demo:forEach>
  	<hr/>
  	<demo:forEach items="${map }" var="student">
  		<p>${student }</p>
  		<p>${student.key }--${student.value }</p>
  	</demo:forEach>
  </body>
</html>
